wordpress if is in category

40

wordpress if is in category -

// Find out in Wordpress (with PHP) if a single/page is in a chosen category
if (in_category('fruit')) {
    echo "This single/page is in category 'fruit'.";
}

Comments

Submit
0 Comments